﻿@{
    Layout = "~/Views/Shared/_Layout_RTU_well.cshtml";
    ViewBag.Title = "首页";
}
<div class="xds-no-breadcrumb">
    <div class="full-height">
        <div class="full-height-scroll white-bg border-left">
            <div class="row">
                <div class="col-sm-4">
                    <ul class="list-group">
                        <li class="list-group-item" style="width:75%;margin-left:13%">
                            <div class="canvas" style="width:100%; height:620px;">
                                <div id="jijiahouduan" style="left:145px; top:63px; width:48px; height:353px; position:absolute; display:none">
                                    <img style="width:100%;height:100%" src="~/images/chouyoujiimages/jijiahouduan.png" />
                                </div>
                                <div id="pidai2" style="left:41px; top:61px; width:16px; height:362px; position:absolute;">
                                    <img style="width:100%;height:100%" src="~/images/chouyoujiimages/pidai2.png" />
                                </div>
                                <div id="pz" style="left:18px; top:358px; width:62px; height:47px; position:absolute;">
                                    <img style="width:100%;height:100%" src="~/images/chouyoujiimages/peizhong1.png" />
                                </div>
                                <div id="jijiaqianduan" style="left:5px; top:3px; width:236px; height:450px; position:absolute;">
                                    <img style="width:100%;height:100%" src="~/images/chouyoujiimages/jingjiaqianduan1.png" />
                                </div>
                                <div id="pidai" style="left:25px; top:45px; width:17px; height:59px; position:absolute;">
                                    <img style="width:100%;height:100%" src="~/images/chouyoujiimages/pidai.png" />
                                </div>
                                <div id="sheng" style="left:31px; top:130px; width:3px; height:435px; position:absolute;">
                                    <img style="width:100%;height:100%" src="~/images/chouyoujiimages/sheng1.png" />
                                </div>
                                <div id="jingkou" style="left:27px; top:405px; width:28px; height:29px; position:absolute;">
                                    <img style="width:100%;height:100%" src="~/images/chouyoujiimages/jingkou.png" />
                                </div>
                                <div id="xuandian" style="left:25px; top:170px; width:16px; height:18px; position:absolute;">
                                    <img style="width:100%;height:100%" src="~/images/chouyoujiimages/xuangua1.png" />
                                </div>
                                <div id="bang" style="left:25px; top:560px; width:13px; height:80px; position:absolute;">
                                    <img style="width:100%;height:100%" src="~/images/chouyoujiimages/bang.png" />
                                </div>
                                @*<div id="data" style="left: 115px; top: 100px; width: 110px; height:auto; position: absolute; background-color: lightgray; border-radius: 4px;padding:2px;display:block">
                                </div>*@
                                <div id="jingshen" style="text-align:center; left: 5px; top: 480px; width: 60px; height: 30px; position: absolute; background-color: white; border-top: 3px outset; border-bottom: 3px outset; border-color: black; padding: 2px">
                                    <b style="margin-left:5px" id="jingshen_value"></b>
                                </div>
                                <div id="bengjing" style="text-align:center; left: 40px; top: 580px; width: 120px; height: 30px; position: absolute; background-color: white; padding: 2px">
                                    <b style="margin-left:5px" id="bengjing_value"></b>
                                </div>
                                <div id="xianchang" style="top:10px;right:10px;position: absolute; background-color: white; padding: 2px">
                                    <button type="button" onclick="gotomodel()" class="" style="background: url(../../Images/camare.jpg) no-repeat;width:40px;height:40px;border:none" data-toggle="modal" data-target="#xianchangModal"></button>
                                </div>
                                <div id="kongzhigui" style="top:50px;right:10px;position: absolute; background-color: white; padding: 2px">
                                    <button type="button" onclick="gotomodel()" class="btn btn-xs btn-primary" data-toggle="modal" data-target="#kongzhiguiModal">控制柜管理</button>
                                </div>
                            </div>
                        </li>
                    </ul>
                    @*<div class="span8" style="width: 100%; float: left;margin-bottom:50px">
                        <div id="" style="width: 90%; margin-left:5%">                            
                             <div id="Pinghenglv" style="width: 50%; height: 120px; float: left; margin: 15px 0px;"></div>
                             <div id="Xitongxiaolv" style="width: 50%; height: 120px; float: left; margin: 15px 0px; "></div>
                        </div>
                    </div>*@
                    <div class="span8" style="width: 100%; float: left; margin-left: 2%">
                        @*<div style="width: 100%; height: 20px; margin: 5px auto;">
                            <select id="LoadOptions" style="float: right; margin-right: 20px;">
                                <option value="1">6h</option>
                                <option value="2">12h</option>
                                <option value="4">24h</option>
                            </select>
                            <b style="float:right;margin-right:80px;font-size:14px">载荷变化图</b>
                        </div>
                        <div id="Load" style="width:100%; height:250px; margin:5px auto"></div>*@
                        <div class="ibox float-e-margins">
                            <div class="ibox-title" style="background-color:ghostwhite">
                                <i class="xds-icon fa fa-bar-chart" style="float:left;margin-right:5px;margin-top:3px"></i>
                                <h5 style="font-size: 16px">载荷变化图</h5>
                                <div class="ibox-tools">
                                    <a class="collapse-link" id="Load-ibox" style="float:right">
                                        <i class="fa fa-chevron-up"></i>
                                    </a>
                                    <select id="LoadOptions" style="float: right; margin-right: 10px;margin-left:10px">
                                        <option value="1">6h</option>
                                        <option value="2">12h</option>
                                        <option value="4">24h</option>
                                    </select>
                                </div>
                            </div>
                            <div id="Loadibox" class="ibox-content" style="background-color:ghostwhite;padding:0px 0px 10px 10px">
                                <div id="Load" style="width:100%; height:250px; margin:5px auto"></div>
                            </div>
                        </div>
                    </div>
                    <div class="span8" style="width: 100%; float: left; margin-left: 2% ">
                        <div class="ibox float-e-margins">
                            <div class="ibox-title" style="background-color:ghostwhite">
                                <i class="xds-icon fa fa-line-chart" style="float:left;margin-right:5px;margin-top:3px"></i>
                                <h5 style="font-size:16px">周期内ABC三相电流平均值</h5>
                                <div class="ibox-tools">
                                    <a class="collapse-link" id="Curr-ibox">
                                        <i class="fa fa-chevron-up"></i>
                                    </a>
                                </div>
                            </div>
                            <div class="ibox-content" style="background-color: ghostwhite; padding: 0px 0px 10px 10px">
                                <div id="Curr" style="width: 100%; height: 250px; margin: 5px auto"></div>
                            </div>
                        </div>
                    </div>
                    
                </div>
                <div class="col-sm-8" style="padding-right:50px;">
                    <div class="row">
                        <div class="col-md-12" id="indicator">
                            <div class="row">
                                <div class="span8 col-sm-4" style="float:left;">
                                    <div id="basicdata" style="width: 100%; height: 310px; margin: 10px auto; padding-top: 0; background-color: ghostwhite; border-radius: 8px; "></div>
                                </div>
                                <div class="span8 col-sm-8" style="float:left">
                                    <div id="indicator-1" style="width: 100%; height: 250px; margin: 0 auto"></div>
                                    <div class="col-sm-12" style="height: 60px; margin: 0 auto;float:left;padding-top:15px">
                                        <div style="width: 35%; height: 60px; float: left">
                                            <strong style="font-size:14px;float:left;margin-top:20px">过去24小时示功图查询</strong>
                                        </div>
                                        <div style="width: 65%; height: 60px; float: left">
                                            <div id="slider1" style="width: 100%; height: 60px; margin: 0 auto"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-12" id="newwarnlog" style="">
                        </div>
                        <div class="span8 col-md-6" style="float: left">
                            <div class="span8" style="width: 100%; float: left;margin-bottom:0px">
                                <div id="" style="width: 90%; margin-left:5%">
                                    <ul class="list-group">
                                        <li class="list-group-item active li_class" id="li_jibenkongzhi" style="background-color: #d6d7de; height: 35px; text-align: center;border:0px solid ">
                                            <b style="color:black">基本控制</b>
                                        </li>
                                        <li class="list-group-item">
                                            <button type="button" class="btn  btn-large btn-success" onclick="start()" style="margin-top:5px;margin-left:10px">启动</button>
                                            <button type="button" class="btn  btn-large btn-warning" onclick="stop()" style="margin-top: 5px; margin-left: 10px">停止</button>
                                            @*<button type="button" class="btn  btn-large btn-danger" onclick="sharpstop()" style="margin-top: 5px; margin-left: 10px">急停</button>*@
                                            @*<ul class="demo-list" style="">
                                                <li>
                                                    <button type="button" class="btn  btn-large btn-success" onclick="start()" style="margin-top:5px;">启动</button>
                                                </li>
                                                <li>
                                                    <button type="button" class="btn  btn-large btn-warning" onclick="stop()" style="margin-top:5px;">停止</button>
                                                </li>
                                                <li>
                                                    <button type="button" class="btn  btn-large btn-danger" onclick="sharpstop()" style="margin-top:5px;">急停</button>
                                                </li>
                                            </ul>*@
                                        </li>
                                    </ul>
                                </div>
                            </div>
                            <div class="span8" style="width: 100%; float: left;margin-bottom:0px;margin-top:10px">
                                <div id="" style="width: 90%; margin-left:5%">
                                    <ul class="list-group">
                                        <li class="list-group-item active li_class" style="background-color: #d6d7de; height: 35px; text-align: center; border: 0px solid; ">
                                            <b style="color:black">控油机中点上下冲程</b>
                                        </li>
                                        <li class="list-group-item">
                                            <div style="width: 100%; height: 60px; float: left">
                                                <div id="slider4" style="width: 100%; height: 60px; margin: 0 auto"></div>
                                            </div>
                                            <button type="button" class="btn ladda-button btn-large btn-primary ladda-button-demo" data-style="zoom-in" id="updatestrokebutton" onclick="updatestroke()" style="margin-top: 5px; width: 80%; margin-left: 10%;">确定</button>
                                        </li>
                                    </ul>
                                </div>
                                @*<div class="col-sm-12" style="height: 140px; margin: 0 auto;float:left;padding-top:5px">
                                    <div style="width: 100%; height: 60px; float: left">
                                        <strong style="font-size:14px;float:left;margin-top:20px">调节上下行冲程</strong>
                                    </div>
                                    <div style="width: 100%; height: 60px; float: left">
                                        <div id="slider4" style="width: 100%; height: 60px; margin: 0 auto"></div>
                                    </div>
                                    <button type="button" class="btn ladda-button btn-large btn-primary ladda-button-demo" data-style="zoom-in" id="updatestroketimebutton" onclick="updatestroketimes()" style="margin-top: 5px; width: 80%; margin-left: 10%;">确定</button>
                                </div>*@
                            </div>
                        </div>
                        <div class="span8 col-md-6" style="float: left;">
                            <div id="" style="width: 90%; margin-left:5%">
                                <ul class="list-group">
                                    <li class="list-group-item active li_class" style="background-color: #d6d7de; height: 35px; text-align: center; border: 0px solid; ">
                                        <b style="color:black">调节变频器输出频率</b>
                                    </li>
                                    <li class="list-group-item">
                                        <b>上行频率</b>
                                        <div id="upstroketimes" style="width:100%;height:50px;"></div>
                                        <b>下行频率</b>
                                        <div id="downstroketimes" style="width:100%;height:50px;"></div>
                                        <button type="button" class="btn ladda-button btn-large btn-primary ladda-button-demo" data-style="zoom-in" id="updatestroketimebutton" onclick="updatestroketimes()" style="margin-top: 5px; width: 80%; margin-left: 10%;">确定</button>
                                    </li>
                                </ul>
                            </div>
                        </div>
                        <div class="span8 col-md-6" style="float: left; padding-left: 2px; padding-right: 2px">
                            @*<div id="Volt" style="width:100%; height:250px; margin:5px auto"></div>*@
                            <div class="ibox float-e-margins">
                                <div class="ibox-title" style="background-color:ghostwhite">
                                    <i class="xds-icon fa fa-line-chart" style="float:left;margin-right:5px;margin-top:3px"></i>
                                    <h5 style="font-size:16px">ABC三相电压有效值</h5>
                                    <div class="ibox-tools">
                                        <a class="collapse-link" id="Volt-ibox">
                                            <i class="fa fa-chevron-up"></i>
                                        </a>
                                    </div>
                                </div>
                                <div class="ibox-content" style="background-color: ghostwhite; padding: 0px 0px 10px 10px">
                                    <div id="Volt" style="width:100%; height:250px; margin:5px auto"></div>
                                </div>
                            </div>
                        </div>
                        <div class="span8 col-md-6" style="float: left; padding-left: 2px; padding-right: 2px; ">
                            @*<div style="width: 100%; height: 20px; margin: 5px auto;">
                                <select id="PowOptions" style="float: right; margin-right: 20px;">
                                    <option value="1">6h</option>
                                    <option value="2">12h</option>
                                    <option value="4">24h</option>
                                </select>
                                <b style="float:right;margin-right:80px;font-size:14px">功率变化图</b>
                            </div>
                            <div id="Pow" style="width: 100%; height: 250px; margin: 5px auto"></div>*@
                                            @*<div class="ibox float-e-margins">
                                <div class="ibox-title" style="background-color:ghostwhite">
                                    <i class="xds-icon fa fa-bar-chart" style="float:left;margin-right:5px;margin-top:3px"></i>
                                    <h5 style="font-size:16px">功率变化图</h5>
                                    <div class="ibox-tools">
                                        <a class="collapse-link" id="Pow-ibox" style="float:right">
                                            <i class="fa fa-chevron-up"></i>
                                        </a>
                                        <select id="PowOptions" style="float: right; margin-right: 10px; margin-left: 10px">
                                            <option value="1">6h</option>
                                            <option value="2">12h</option>
                                            <option value="4">24h</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="ibox-content" style="background-color: ghostwhite; padding: 0px 0px 10px 10px">
                                    <div id="Pow" style="width: 100%; height: 250px; margin: 5px auto"></div>
                                </div>
                            </div>*@
                            <div class="ibox float-e-margins">
                                <div class="ibox-title" style="background-color:ghostwhite">
                                    <i class="xds-icon fa fa-line-chart" style="float:left;margin-right:5px;margin-top:3px"></i>
                                    <h5 style="font-size:16px">变频器输出电流</h5>
                                    <div class="ibox-tools">
                                        <a class="collapse-link" id="BianOut-ibox">
                                            <i class="fa fa-chevron-up"></i>
                                        </a>
                                    </div>
                                </div>
                                <div class="ibox-content" style="background-color: ghostwhite; padding: 0px 0px 10px 10px">
                                    <div id="BianOut" style="width: 100%; height: 250px; margin: 5px auto"></div>
                                </div>
                            </div>
                        </div>
                        <div class="span8 col-sm-6" style="float:left;margin-bottom:40px">
                            <div id="indicator-2" style="width: 100%; height: 250px; margin: 0 auto"></div>
                            <div class="col-sm-12" style="height: 60px; margin: 0 auto;float:left;padding-top:15px">
                                @*<div style="width: 35%; height: 60px; float: left">
                                    <strong style="font-size:14px;float:left;margin-top:20px">过去24小时示功图查询</strong>
                                </div>*@
                                <div style="width: 100%; height: 60px; float: left">
                                    <div id="slider2" style="width: 100%; height: 60px; margin: 0 auto"></div>
                                </div>
                            </div>
                        </div>
                        <div class="span8 col-sm-6" style="float: left; margin-bottom: 40px">
                            <div id="indicator-3" style="width: 100%; height: 250px; margin: 0 auto"></div>
                            <div class="col-sm-12" style="height: 60px; margin: 0 auto;float:left;padding-top:15px">
                                @*<div style="width: 35%; height: 60px; float: left">
                                    <strong style="font-size:14px;float:left;margin-top:20px">过去24小时示功图查询</strong>
                                </div>*@
                                <div style="width: 100%; height: 60px; float: left">
                                    <div id="slider3" style="width: 100%; height: 60px; margin: 0 auto"></div>
                                </div>
                            </div>
                        </div>
                        
                        
                        @*<div class="span8 col-md-6" style="float: left">
                            <div class="ibox float-e-margins">
                                <div class="ibox-title" style="background-color:ghostwhite">
                                    <i class="xds-icon fa fa-line-chart" style="float:left;margin-right:5px;margin-top:3px"></i>
                                    <h5 style="font-size:16px">变频器输出电流</h5>
                                    <div class="ibox-tools">
                                        <a class="collapse-link" id="BianOut-ibox">
                                            <i class="fa fa-chevron-up"></i>
                                        </a>
                                    </div>
                                </div>
                                <div class="ibox-content" style="background-color: ghostwhite; padding: 0px 0px 10px 10px">
                                    <div id="BianOut" style="width: 100%; height: 250px; margin: 5px auto"></div>
                                </div>
                            </div>
                        </div>*@
                        @*<div class="span8 col-md-6" style="float: left">
                            <div class="ibox float-e-margins">
                                <div class="ibox-title" style="background-color:ghostwhite">
                                    <i class="xds-icon fa fa-bar-chart" style="float:left;margin-right:5px;margin-top:3px"></i>
                                    <h5 style="font-size:16px">压力</h5>
                                    <div class="ibox-tools">
                                        <a class="collapse-link" id="Press-ibox" style="float:right">
                                            <i class="fa fa-chevron-up"></i>
                                        </a>
                                        <select id="PressOptions" style="float: right; margin-right: 10px; margin-left: 10px;">
                                            <option value="1">6h</option>
                                            <option value="2">12h</option>
                                            <option value="4">24h</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="ibox-content" style="background-color: ghostwhite; padding: 0px 0px 10px 10px">
                                    <div id="Press" style="width:100%; height:250px; margin:5px auto"></div>
                                </div>
                            </div>
                        </div>*@
                        @*<div class="span8 col-md-6" style="float: right">
                            <div class="ibox float-e-margins">
                                <div class="ibox-title" style="background-color:ghostwhite">
                                    <i class="xds-icon fa fa-bar-chart" style="float:left;margin-right:5px;margin-top:3px"></i>
                                    <h5 style="font-size:16px">温度</h5>
                                    <div class="ibox-tools">
                                        <a class="collapse-link" id="Temp-ibox">
                                            <i class="fa fa-chevron-up"></i>
                                        </a>
                                    </div>
                                </div>
                                <div class="ibox-content" style="background-color: ghostwhite; padding: 0px 0px 10px 10px">
                                    <div id="Temp" style="width: 100%; height: 530px; margin: 5px auto"></div>
                                </div>
                            </div>
                        </div>*@
                        @*<div class="span8 col-md-6" style="float: left; margin-bottom: 50px">
                            <div class="ibox float-e-margins">
                                <div class="ibox-title" style="background-color:ghostwhite">
                                    <i class="xds-icon fa fa-bar-chart" style="float:left;margin-right:5px;margin-top:3px"></i>
                                    <h5 style="font-size:16px">伴热温度与伴热压力</h5>
                                    <div class="ibox-tools">
                                        <a class="collapse-link" id="PressAndTemp-ibox" style="float:right">
                                            <i class="fa fa-chevron-up"></i>
                                        </a>
                                        <select id="PressAndTempOptions" style="float: right; margin-right: 10px; margin-left: 10px;">
                                            <option value="1">6h</option>
                                            <option value="2">12h</option>
                                            <option value="4">24h</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="ibox-content" style="background-color: ghostwhite; padding: 0px 0px 10px 10px; min-height: 355px">
                                    <div id="PressAndTemp" style="width:100%; height:350px; margin:5px auto;float:left"></div>
                                </div>
                            </div>
                        </div>*@
                    </div>
                 </div>
            </div>
            <div class="modal inmodal" id="xianchangModal" tabindex="-1" role="dialog" aria-hidden="true">
                <div class="modal-dialog" style="width:1000px">
                    <div class="modal-content animated bounceInRight">
                        <div class="modal-header" style="padding:0">
                            <h4 class="modal-title">油井监控</h4>
                        </div>
                        <div class="modal-body" style="padding:5px 2px 5px 30px;height:455px">
                            <div style="float:left">
                                <figure>
                                    <iframe height=455 width=445 id="videopath" src='http://player.youku.com/embed/XMjU1MTM5Nzk4OA==' frameborder=0 allowfullscreen></iframe>
                                </figure>
                            </div>
                            <div id="mapcontainer" class="mapcontainer" style="width:500px;height:455px;left:490px"></div>
                        </div>
                        <div class="modal-footer clear" style="width:100%">
                            <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="closevideo()">Close</button>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal inmodal" id="kongzhiguiModal" tabindex="-1" role="dialog" aria-hidden="true">
                <div class="modal-dialog" style="width:450px">
                    <div class="modal-content animated bounceInRight">
                        <div class="modal-header" style="padding:0">
                            <h4 class="modal-title">控制柜管理</h4>
                        </div>
                        <div class="modal-body" id="xds_kongzhigui" style="padding:0px 0px 0px 0px;height:520px; background-image:url(../../Images/control.png); background-size:100% 100%;">
                            <font id="xds_data" style="top:303px;right:80px; position:absolute;" size="5">58461A</font>
                            <div id="xds_red" class="xds_top" style="left:60px;top:65px; background-image:url(../../Images/red.png)"></div>
                            <div id="xds_green1" class="xds_top" style="left:150px;top:65px; background-image:url(../../Images/green.png)"></div>
                            <div id="xds_yellow" class="xds_top" style="left:240px;top:65px; background-image:url(../../Images/yellow.png)"></div>
                            <div id="xds_green2" class="xds_top" style="left:330px;top:65px; background-image:url(../../Images/green.png)"></div>
                            <div id="xds_left" class="xds_bottom" style="left:40px;top:245px; background-image:url(../../Images/right.png)"></div>
                            <div id="xds_right" class="xds_bottom" style="left:130px;top:245px; background-image:url(../../Images/right.png)"></div>
                            <div style="top:218px;left:350px; height:16px;width:35px;border-bottom:1px solid #0026ff; position:absolute; cursor:pointer;"onclick="xdsdianya()"></div>
                            <div style="top:237px;left:335px; height:16px;width:35px;border-bottom:1px solid #0026ff; position:absolute; cursor:pointer;" onclick="xdsdianliu()"></div>
                            <div style="top:252px;left:315px; height:16px;width:35px;border-bottom:1px solid #0026ff; position:absolute; cursor:pointer;" onclick="xdspinlv()"></div>
                            <div class="circle" id="circle" style="top:300px; left:384px;"></div>
                        </div>
                        <div class="modal-footer clear" style="width:100%">
                            <button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal inmodal" id="myModal2" tabindex="-1" role="dialog" aria-hidden="true" style="display: none;">
                <div class="modal-dialog" style="width:400px">
                    <div class="modal-content animated bounceInRight">
                        <div class="modal-header" style="padding:0">
                            <h4 class="modal-title">人工智能优化</h4>
                        </div>
                        <div class="modal-body" style="padding:5px 2px 5px 30px;height:100px">
                            根据示功图判定当前油井状态为：<b>运行正常</b><br>
                        </div>
                        <div class="modal-footer clear" style="width:100%">
                            <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="closevideo()">Close</button>
                        </div>
                    </div>
                </div>
            </div>

            <div class="modal inmodal" id="myModal3" tabindex="-1" role="dialog" aria-hidden="true">
                <div class="modal-dialog" style="width:300px">
                    <div class="modal-content animated bounceInRight">
                        <div class="modal-header" style="padding:0">
                            <h4 class="modal-title">报警通知</h4>
                        </div>
                        <div class="modal-body" style="padding:5px 2px 5px 30px;height:150px">
                            <div id="workercontainer" class="mapcontainer" style="width:260px;height:130px;left:20px">
                                <select id="Options" style="margin: 22px 0 12px 0; width: 260px;">
                                    <option></option>
                                </select>
                                <div id="informinformation" style="margin: 22px 0 12px 0; width: 260px; height:20px">
                                </div>
                            </div>
                        </div>
                        <div class="modal-footer clear" style="width:100%">
                            <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="makeinform()">确定</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@section Styles {
    @Styles.Render("~/Content/plugins/ionRangeSlider/ionRangeStyles")
    @Styles.Render("~/plugins/c3Styles")
    @Styles.Render("~/plugins/laddaStyles")
    @Styles.Render("~/plugins/sweetAlertStyles")
    <link href="~/Content/animate1.css" rel="stylesheet" />
    <style type="text/css">
        /*#li1, #li_jibenkongzhi {
            margin-top: 10px;
            font-size: 24px;
            font-family:KaiTi;
            text-shadow: 0 0px 0px black;
            color: black;
            text-align: center;
            background-color: #1ab394;
        }*/
        .circle{
            width: 8px;
            height: 8px;
            background-color:red;
            border-radius: 4px; 
            background-color:#ff0000; 
            position:absolute;
        }
        .xds_top{
            width:60px;
            height:60px;
            position:absolute;
            background-repeat:no-repeat; 
            background-size:100% 100%;
        }
        .xds_bottom{
            width:70px;
            height:70px;
            position:absolute;
            background-repeat:no-repeat; 
            background-size:100% 100%;
        }
    </style>
}

@section Scripts {
    @Scripts.Render("~/plugins/ionRange")
    @Scripts.Render("~/bundles/echarts")
    @Scripts.Render("~/bundles/highchartjs")
    @Scripts.Render("~/plugins/d3")
    @Scripts.Render("~/plugins/c3")
    @Scripts.Render("~/plugins/ladda")
    @Scripts.Render("~/plugins/sweetAlert")
    <script type="text/javascript">
        var charts = [];
        var par = new Array();//用来存冲程冲次参数
        var colorplan;
        var bianpindata = [];
        $(document).ready(function () {
            getbasedata();
            getindd();
            getelecd();
            getcurr();
            getimportant();
            getinfo_important();
            getmain();
            getadjuimportant();
            setInterval("getadjuimportant()", 5000);
            getwarn();
            $("#LoadOptions").change(function () {
                getsecondchartvalue($('#LoadOptions option:selected').val());
            });
            //$("#PowOptions").change(function () {
            //    getthirdchartvalue($('#PowOptions option:selected').val());
            //});
            //$("#PressOptions").change(function () {
            //    getsixthchartvalue($('#PressOptions option:selected').val());
            //});
            //$("#PressAndTempOptions").change(function () {
            //    geteighthchartvalue($('#PressAndTempOptions option:selected').val());
            //});
            $('.xds-minimalize').click(function () {
                setTimeout("ReDrawChart()", 400);
            });
        })
        function xdsdianya() {
            $("#xds_data").text(bianpindata[0] + "V");
            $("#circle").css("top", "300px");
        }
        function xdsdianliu() {
            $("#xds_data").text(bianpindata[1] + "A");
            $("#circle").css("top", "313px");
        }
        function xdspinlv() {
            $("#xds_data").text(bianpindata[2] + "Hz");
            $("#circle").css("top", "327px");
        }
        function getinfo_important() {
            $.ajax({
                url: '/FirstPage/INFO_Important_Data',
                data: { wellid: sessionStorage.wellid },
                type: 'post',
                async: false,
                dataType: 'json'
            }).success(function (result) {
                bianpindata.push(result.data2[0].MW1019);
                bianpindata.push(result.data2[0].MW1020/10);
                bianpindata.push(result.data2[0].MW1018/100);
                $("#xds_data").text(result.data2[0].MW1019+"V");
                if (result.data1[0].M1001.trim() != "0")
                    $("#xds_green1").css("background", "url(../../Images/greenlight.png)");
                $("#xds_green1").css("background-repeat", "no-repeat");
                $("#xds_green1").css("background-size", "100% 100%");
                if (result.data3[0].MW0053.trim() != "0")
                    $("#xds_yellow").css("background", "url(../../Images/yellowlight.png)");
                $("#xds_yellow").css("background-repeat", "no-repeat");
                $("#xds_yellow").css("background-size", "100% 100%");
                if (result.data1[0].M1003.trim() != "0")
                    $("#xds_green2").css("background", "url(../../Images/greenlight.png)");
                $("#xds_green2").css("background-repeat", "no-repeat");
                $("#xds_green2").css("background-size", "100% 100%");
                if (result.data1[0].M1007.trim() != "0")
                    $("#xds_left").css("background", "url(../../Images/left.png)");
                $("#xds_left").css("background-repeat", "no-repeat");
                $("#xds_left").css("background-size", "100% 100%");
                if (result.data1[0].M1008.trim() != "0")
                    $("#xds_right").css("background", "url(../../Images/left.png)");
                $("#xds_right").css("background-repeat", "no-repeat");
                $("#xds_right").css("background-size", "100% 100%");
            }).error(function () {
                swal({
                    title: "Welcome in Alerts",
                    text: "The connection between server and units is not very stable. For any technical assistant, please call 1-(517)-927-5910."
                });
            });
        }
        function ReDrawChart() {
            $(charts).each(function (index, chart) {
                chart.resize();
            });
        }
        function getbasedata() {
            $.ajax({
                url: '/FirstPage/OtherInfo',
                data: { wellid: sessionStorage.wellid },
                type: 'post',
                async: false,
                dataType: 'json'
            }).success(function (result) {
                $('#basicdata').append('<table class="table table-striped" id="basicdata1"><thead><tr><th style = "text-align:center;">油井基本信息</th></tr></thead><tbody></tbody></table>')
                littlediv = $('#basicdata1');
                var weizhijixing = result.data.Station.split('_');
                littlediv.append('<tr><td>' + '位置' + '</td><td>' + weizhijixing[0] + sessionStorage.wellname + '</td></tr>');
                littlediv.append('<tr><td>' + '机型' + '</td><td>' + weizhijixing[1] + '</td></tr>');
                littlediv.append('<tr><td>' + '冲程' + '</td><td id="freshstoke">7m</td></tr>');
                littlediv.append('<tr><td>' + '冲次' + '</td><td id="freshstoketime">2.6次/min</td></tr>');
                littlediv.append('<tr><td>' + '上行电流' + '</td><td id="upcurrent">71.5A</td></tr>');
                littlediv.append('<tr><td>' + '下行电流' + '</td><td id="downcurrent">61.8A</td></tr>');
                littlediv.append('<tr><td>' + '当前配重' + '</td><td>2.1吨</td></tr>');
                littlediv.append('<button type="button" class="btn btn-xs btn-primary" data-toggle="modal" data-target="#myModal2">人工智能优化</button>');
                $("#jingshen_value").text(result.data.Deep);
                $("#bengjing_value").text(result.data.Diameter);
            }).error(function () {
                swal({
                    title: "Welcome in Alerts",
                    text: "The connection between server and units is not very stable. For any technical assistant, please call 1-(517)-927-5910."
                });
            });
        }
        function getindd() {
            $("#indicator-1").attr("value",null);//先把value值赋空，在对其赋值
            $.ajax({
                url: '/FirstPage/SIGN_INDD',
                data: { wellid: sessionStorage.wellid },
                type: 'post',
                async: false,
                dataType: 'json'
            }).success(function (result) {
                if (result.status == 0) {
                    var time = new Array();
                    var scale = result.scale.Scaler;
                    scale = 1 / scale;
                    $.each(result.data, function (i, item) {
                        var t1 = (item.Time.split('('))[1].split(')');
                        var t2 = new Date(parseFloat(t1[0]));
                        var dispdata = item.MW4097 + item.MW4107 + item.MW4117 + item.MW4127 + item.MW4137 + item.MW4147 + item.MW4157 + item.MW4167 + item.MW4177 + item.MW4187 + item.MW4197 + item.MW4207 + item.MW4217 + item.MW4227 + item.MW4237 + item.MW4247 + item.MW4257 + item.MW4267 + item.MW4277 + item.MW4287;
                        var loaddata = item.MW4297 + item.MW4307 + item.MW4317 + item.MW4327 + item.MW4337 + item.MW4347 + item.MW4357 + item.MW4367 + item.MW4377 + item.MW4387 + item.MW4397 + item.MW4407 + item.MW4417 + item.MW4427 + item.MW4437 + item.MW4447 + item.MW4457 + item.MW4467 + item.MW4477 + item.MW4487;
                        var datatime = t2.getFullYear() + '/' + (parseFloat(t2.getMonth()) + 1) + '/' + t2.getDate() + ' ' + t2.getHours() + ':' + t2.getMinutes() + ':' + t2.getSeconds();
                        $("#indicator-1").attr("value", datatime + "_" + dispdata + '_' + loaddata + "--" + $("#indicator-1").attr("value"));
                        time[i] = new Object();
                        time[i] = datatime;
                        $("#Load").attr("value", datatime + "_" + item.MW4095/scale + '_' + item.MW4096/scale + "--" + $("#Load").attr("value"));
                        //$("#Load").attr("value", datatime + "_" + i*2 + '_' + i*1 + "--" + $("#Load").attr("value"));
                        //if (i == 0) {
                        //    littlediv = $('#data');
                        //    littlediv.append('<b style="font-size:6px">' + '上行冲次:' + '</b><b style="font-size:6px">' + item.MW4093 / 100 + '次/分钟</b><br/>');
                        //    littlediv.append('<b style="font-size:6px">' + '下行冲次:' + '</b><b style="font-size:6px">' + item.MW4094 / 100 + '次/分钟</b><br/><br/>');
                        //    littlediv.append('<b style="font-size:6px">' + '冲程:' + '</b><b style="font-size:6px">' + item.MW4091 / 100 + '米</b><br/>');
                        //    littlediv.append('<b style="font-size:6px">' + '当前配重:' + '</b><b style="font-size:6px">2.1吨</b><br/>');
                        //}
                    });
                    SetIndicator(time);
                    getsecondchartvalue(1);
                }
                else {
                    $('.collapse-link#Load-ibox').click();
                }
            }).error(function () {
                $('.collapse-link#Load-ibox').click();
                swal({
                    title: "Welcome in Alerts",
                    text: "The connection between server and units is not very stable. For any technical assistant, please call 1-(517)-927-5910."
                });
            });
        }
        function getelecd() {
            $("#indicator-2").attr("value", null);//先把value值赋空，在对其赋值
            $("#indicator-3").attr("value", null);//先把value值赋空，在对其赋值
            $.ajax({
                url: '/FirstPage/SIGN_ELECD',
                data: { wellid: sessionStorage.wellid },
                type: 'post',
                async: false,
                dataType: 'json'
            }).success(function (result) {
                if (result.status == 0) {
                    var time = new Array();
                    var scale1 = result.scale1.Scaler;
                    scale1 = 1 / scale1;
                    var scale2 = result.scale2.Scaler;
                    scale2 = 1 / scale2;
                    $.each(result.data, function (i, item) {
                        var t1 = (item.Time.split('('))[1].split(')');
                        var t2 = new Date(parseFloat(t1[0]));
                        var dispdata = item.MW4097 + item.MW4147 + item.MW4197 + item.MW4247;
                        var currdata = item.MW4497 + item.MW4547 + item.MW4597 + item.MW4647;
                        var powdata = item.MW4697 + item.MW4747 + item.MW4797 + item.MW4847;
                        var datatime = t2.getFullYear() + '/' + (parseFloat(t2.getMonth()) + 1) + '/' + t2.getDate() + ' ' + t2.getHours() + ':' + t2.getMinutes() + ':' + t2.getSeconds();
                        $("#indicator-2").attr("value", datatime + "_" + dispdata + '_' + currdata + "--" + $("#indicator-2").attr("value"));
                        $("#indicator-3").attr("value", datatime + "_" + dispdata + '_' + powdata + "--" + $("#indicator-3").attr("value"));
                        time[i] = new Object();
                        time[i] = datatime;
                        //$("#Load").attr("value", datatime + "_" + i*2 + '_' + i*1 + "--" + $("#Load").attr("value"));
                        //if (i == 0) {
                        //    littlediv = $('#data');
                        //    littlediv.append('<b style="font-size:6px">' + '上行冲次:' + '</b><b style="font-size:6px">' + item.MW4093 / 100 + '次/分钟</b><br/>');
                        //    littlediv.append('<b style="font-size:6px">' + '下行冲次:' + '</b><b style="font-size:6px">' + item.MW4094 / 100 + '次/分钟</b><br/><br/>');
                        //    littlediv.append('<b style="font-size:6px">' + '冲程:' + '</b><b style="font-size:6px">' + item.MW4091 / 100 + '米</b><br/>');
                        //    littlediv.append('<b style="font-size:6px">' + '当前配重:' + '</b><b style="font-size:6px">2.1吨</b><br/>');
                        //}
                    });
                    SetOtherIndicator(time);
                }
                else {
                }
            }).error(function () {
                swal({
                    title: "Welcome in Alerts",
                    text: "The connection between server and units is not very stable. For any technical assistant, please call 1-(517)-927-5910."
                });
            });
        }
        function getimportant() {
            $.ajax({
                url: '/FirstPage/SIGN_IMPORTANT',
                data: { wellid: sessionStorage.wellid },
                type: 'post',
                async: false,
                dataType: 'json'
            }).success(function (result) {
                if (result.status == 0) {
                    var timedata = new Array();
                    var voltdataA = new Array();
                    var voltdataB = new Array();
                    var voltdataC = new Array();
                    var tempdata1 = new Array();
                    var tempdata2 = new Array();
                    var bianout = new Array();
                    var phl;
                    var xtxl;
                    $.each(result.data, function (i, item) {
                        var t1 = (item.Time.split('('))[1].split(')');
                        var t2 = new Date(parseFloat(t1[0]));
                        var datatime = t2.getFullYear() + '/' + (parseFloat(t2.getMonth()) + 1) + '/' + t2.getDate() + ' ' + t2.getHours() + ':' + t2.getMinutes() + ':' + t2.getSeconds();
                        timedata[i] = new Object();
                        timedata[i] = datatime;
                        $("#Pow").attr("value", datatime + "_" + item.MW1041/10 + '_' + item.MW1042/10 + "--" + $("#Pow").attr("value"));
                        $("#Press").attr("value", datatime + "_" + item.MW1009 + '_' + item.MW1011 + '_' + item.MW1017 + "--" + $("#Press").attr("value"));

                        //$("#Pow").attr("value", datatime + "_" + i*1 + '_' + i*1 + "--" + $("#Pow").attr("value"));
                        //$("#Press").attr("value", datatime + "_" + i * 2 + '_' + i * 2 + '_' + i * 2 + "--" + $("#Press").attr("value"));
                        voltdataA.push([datatime, item.MW1035 / 10]);
                        voltdataB.push([datatime, item.MW1036 / 10]);
                        voltdataC.push([datatime, item.MW1037 / 10]);
                        bianout.push([datatime, item.MW1020 / 10]);
                        tempdata1.push(item.MW1010);
                        tempdata2.push(item.MW1008);
                        //voltdataA.push([datatime, i + 1]);
                        //voltdataB.push([datatime, i + 2]);
                        //voltdataC.push([datatime, i + 3]);
                        //currdataA.push([datatime, i + 4]);
                        //currdataB.push([datatime, i + 5]);
                        //currdataC.push([datatime, i + 6]);
                        //tempdata1.push(i+7);
                        //tempdata2.push(i+8);
                        if (i == 0) {
                            phl = item.Calc001;
                            xtxl = item.MW1041 / item.MW1043 * 100;
                            xtxl = xtxl.toFixed(2);
                            //phl = phl.toFixed(1);
                            //phl =90.4;
                            //xtxl = 50.2;
                        }
                    });
                    //getthirdchartvalue(1);
                    drawfourthcharts(timedata, voltdataA, voltdataB, voltdataC);
                    //getsixthchartvalue(1);
                    //drawseventhcharts(timedata, tempdata1, tempdata2);
                    //drawninethcharts(phl);
                    //drawtenthcharts(xtxl);
                    drawbianoutcharts(timedata, bianout);
                }
                else {
                    $('.collapse-link#Pow-ibox').click();
                    $('.collapse-link#Press-ibox').click();
                    $('.collapse-link#Volt-ibox').click();
                    $('.collapse-link#Temp-ibox').click();
                    $('.collapse-link#BianOut-ibox').click();
                }
            }).error(function () {
                $('.collapse-link#Pow-ibox').click();
                $('.collapse-link#Press-ibox').click();
                $('.collapse-link#Volt-ibox').click();
                $('.collapse-link#Temp-ibox').click();
                $('.collapse-link#BianOut-ibox').click();
                swal({
                    title: "Welcome in Alerts",
                    text: "The connection between server and units is not very stable. For any technical assistant, please call 1-(517)-927-5910."
                });
            });
        }
        function getcurr() {
            $.ajax({
                url: '/FirstPage/SIGN_PER_CURR_VOLT_POW',
                data: { wellid: sessionStorage.wellid },
                type: 'post',
                async: false,
                dataType: 'json'
            }).success(function (result) {
                if (result.status == 0) {
                    var timedata = new Array();
                    var currdataA = new Array();
                    var currdataB = new Array();
                    var currdataC = new Array();
                    $.each(result.data, function (i, item) {
                        var t1 = (item.Time.split('('))[1].split(')');
                        var t2 = new Date(parseFloat(t1[0]));
                        var datatime = t2.getFullYear() + '/' + (parseFloat(t2.getMonth()) + 1) + '/' + t2.getDate() + ' ' + t2.getHours() + ':' + t2.getMinutes() + ':' + t2.getSeconds();
                        timedata[i] = new Object();
                        timedata[i] = datatime;

                        currdataA.push([datatime, item.MW1172 / 10]);
                        currdataB.push([datatime, item.MW1173 / 10]);
                        currdataC.push([datatime, item.MW1174 / 10]);
                    });
                    drawfifthcharts(timedata, currdataA, currdataB, currdataC);
                }
                else {
                    $('.collapse-link#Curr-ibox').click();
                }
            }).error(function () {
                $('.collapse-link#Curr-ibox').click();
                swal({
                    title: "Welcome in Alerts",
                    text: "The connection between server and units is not very stable. For any technical assistant, please call 1-(517)-927-5910."
                });
            });
        }
        function getmain() {
            $.ajax({
                url: '/FirstPage/SIGN_Main',
                data: { wellid: sessionStorage.wellid },
                type: 'post',
                async: false,
                dataType: 'json'
            }).success(function (result) {
                if (result.status == 0) {
                    var timedata = new Array();
                    $.each(result.data, function (i, item) {
                        var t1 = (item.Time.split('('))[1].split(')');
                        var t2 = new Date(parseFloat(t1[0]));
                        var datatime = t2.getFullYear() + '/' + (parseFloat(t2.getMonth()) + 1) + '/' + t2.getDate() + ' ' + t2.getHours() + ':' + t2.getMinutes() + ':' + t2.getSeconds();
                        timedata[i] = new Object();
                        timedata[i] = datatime;
                        $("#PressAndTemp").attr("value", datatime + "_" + item.MW1017 + '_' + item.MW1016 + "--" + $("#PressAndTemp").attr("value"));

                        //$("#PressAndTemp").attr("value", datatime + "_" + i*1 + '_' + i * 2 + "--" + $("#PressAndTemp").attr("value"));

                    });
                    //geteighthchartvalue(1);
                }
                else {
                    $('.collapse-link#PressAndTemp-ibox').click();
                }
            }).error(function () {
                $('.collapse-link#PressAndTemp-ibox').click();
                swal({
                    title: "Welcome in Alerts",
                    text: "The connection between server and units is not very stable. For any technical assistant, please call 1-(517)-927-5910."
                });
            });
        }
        function getadjuimportant() {
            $.ajax({
                url: '/FirstPage/ADJU_IMPORTANT',
                data: { wellid: sessionStorage.wellid },
                type: 'post',
                async: true,
                dataType: 'json'
            }).success(function (result) {
                if (result.status == 0) {
                    var mw0006_scale = 1/result.structure[0].Scaler;
                    var mw0007_scale = 1 / result.structure[1].Scaler;
                    var mw0011_scale = 1 / result.structure[2].Scaler;
                    var mw0006_unit = result.structure[0].Unit;
                    var mw0007_unit = result.structure[1].Unit;
                    var mw0011_unit = result.structure[2].Unit;
                    $('#freshstoke').text(result.addition.MW0006 / mw0006_scale + mw0006_unit);
                    $('#freshstoketime').text(result.addition.MW0007 / mw0007_scale + mw0007_unit);
                    $('#upcurrent').text(result.updata.MW0011 / mw0011_scale + mw0011_unit);
                    $('#downcurrent').text(result.downdata.MW0011 / mw0011_scale + mw0011_unit);
                    //littlediv.append('<tr><td>' + '冲程' + '</td><td>' + result.addition.MW0006 / mw0006_scale + mw0006_unit + '</td></tr>');
                    //littlediv.append('<tr><td>' + '冲次' + '</td><td>' + result.addition.MW0007 / mw0007_scale + mw0007_unit + '</td></tr>');
                    //littlediv.append('<tr><td>' + '上行电流' + '</td><td>' + result.updata.MW0011 / mw0011_scale + mw0011_unit + '</td></tr>');
                    //littlediv.append('<tr><td>' + '下行电流' + '</td><td>' + result.downdata.MW0011 / mw0011_scale + mw0011_unit + '</td></tr>');
                    //littlediv.append('<tr><td>' + '当前配重' + '</td><td>2.1吨</td></tr>');
                    
                    //set adjustment bars
                    var upstroke_ = result.data.MW1589;
                    var downstroke_ = result.data.MW1590;
                    var upstrokefeq_ = result.data.MW1591;
                    var downstrokefeq_ = result.data.MW1592;
                    var stroke_scale = 1 / result.adjustructure[0].Scaler;
                    var stroke_unit = result.adjustructure[0].Unit;
                    var strokefeq_scale = 1 / result.adjustructure[1].Scaler;
                    var strokefeq_unit = result.adjustructure[1].Unit;
                    var stokesum = Math.round((upstroke_ / stroke_scale + Math.abs(downstroke_ / stroke_scale))*100) / 100;
                    $("#slider4").ionRangeSlider({
                        min: 0,
                        max: upstroke_ / stroke_scale + Math.abs(downstroke_ / stroke_scale) + upstroke_ / stroke_scale / 10 + Math.abs(downstroke_ / stroke_scale) / 10,
                        from: Math.abs(downstroke_ / stroke_scale),
                        to: stokesum,
                        type: 'double',
                        step: 0.1,
                        postfix: "米",
                        maxPostfix: "+",
                        prettify: false,
                        hasGrid: true
                    });
                    //alert(upstroke_ / stroke_scale + Math.abs(downstroke_ / stroke_scale));
                    //$("#upstroke").ionRangeSlider({
                    //    min: upstroke_ / stroke_scale - upstroke_ / stroke_scale / 10,
                    //    max: upstroke_ / stroke_scale + upstroke_ / stroke_scale / 10,
                    //    from: upstroke_ / stroke_scale,
                    //    step: 1 / stroke_scale,
                    //    type: 'single',
                    //    postfix: stroke_unit,
                    //    hasGrid: true
                    //});
                    //$("#downstroke").ionRangeSlider({
                    //    min: Math.abs(downstroke_ / stroke_scale) - Math.abs(downstroke_ / stroke_scale) / 10,
                    //    max: Math.abs(downstroke_ / stroke_scale) + Math.abs(downstroke_ / stroke_scale) / 10,
                    //    from: Math.abs(downstroke_ / stroke_scale),
                    //    step: 1 / stroke_scale,
                    //    type: 'single',
                    //    postfix: stroke_unit,
                    //    hasGrid: true
                    //});
                    $("#upstroketimes").ionRangeSlider({
                        min: upstrokefeq_ / strokefeq_scale - upstrokefeq_ / strokefeq_scale / 10,
                        max: upstrokefeq_ / strokefeq_scale + upstrokefeq_ / strokefeq_scale / 10,
                        from: upstrokefeq_ / strokefeq_scale,
                        step: 1 / strokefeq_scale,
                        type: 'single',
                        postfix: strokefeq_unit,
                        hasGrid: true
                    });
                    $("#downstroketimes").ionRangeSlider({
                        min: downstrokefeq_ / strokefeq_scale - downstrokefeq_ / strokefeq_scale / 10,
                        max: downstrokefeq_ / strokefeq_scale + downstrokefeq_ / strokefeq_scale / 10,
                        from: downstrokefeq_ / strokefeq_scale,
                        step: 1 / strokefeq_scale,
                        type: 'single',
                        postfix: strokefeq_unit,
                        hasGrid: true
                    });
                  
                } else if(result.status == 3){
                    swal({
                        title: "Welcome in Alerts!",
                        text: "No data."
                    });
                } else if (result.status == 2) {
                    swal({
                        title: "Welcome in Alerts!",
                        text: "Permission denied."
                    });
                }
            }).error(function () {
                swal({
                    title: "Welcome in Alerts",
                    text: "The connection between server and units is not very stable. For any technical assistant, please call 1-(517)-927-5910."
                });
            });

           
        }
        function SetIndicator(time) {
            var time1 = new Array();
            for (var i = 0, j = 0; j < time.length - 1; i++, j++)
            {
                time1[i] = new Object();
                time1[i] = time[j];
            }
            $("#slider1").ionRangeSlider({
                values: time1,
                type: 'single',
                hasGrid: true,
                onFinish: function (obj) {
                    getoneindicatorvalue();
                }
            });
            getoneindicatorvalue();
        }
        function SetOtherIndicator(time) {
            var time1 = new Array();
            for (var i = 0, j = 0; j < time.length - 1; i++, j++) {
                time1[i] = new Object();
                time1[i] = time[j];
            }
            $("#slider2").ionRangeSlider({
                values: time1,
                type: 'single',
                hasGrid: true,
                onFinish: function (obj) {
                    gettwoindicatorvalue();
                }
            });
            $("#slider3").ionRangeSlider({
                values: time1,
                type: 'single',
                hasGrid: true,
                onFinish: function (obj) {
                    getthreeindicatorvalue();
                }
            });
            gettwoindicatorvalue();
            getthreeindicatorvalue();
        }
        function getoneindicatorvalue() {
            var t = $("#slider1").attr('value');
            var s = $("#indicator-1").attr("value").split('--');
            var x = s[t];//得到选中的那个
            var value = x.split('_');//这样分隔之后，第一个是时间，后两个是数据
            var dispdata = value[1].split(' ');
            var loaddata = value[2].split(' ');
            drawfirstcharts(value[0], dispdata, loaddata, "indicator-1", "示功图", "位移", "米", "载荷", "KN");
        }
        function gettwoindicatorvalue() {
            var t = $("#slider2").attr('value');
            var s = $("#indicator-2").attr("value").split('--');
            var x = s[t];//得到选中的那个
            var value = x.split('_');//这样分隔之后，第一个是时间，后两个是数据
            var dispdata = value[1].split(' ');
            var currdata = value[2].split(' ');
            drawfirstcharts(value[0], dispdata, currdata, "indicator-2", "电流功图", "位移", "米", "电流", "A");
        }
        function getthreeindicatorvalue() {
            var t = $("#slider3").attr('value');
            var s = $("#indicator-3").attr("value").split('--');
            var x = s[t];//得到选中的那个
            var value = x.split('_');//这样分隔之后，第一个是时间，后两个是数据
            var dispdata = value[1].split(' ');
            var powdata = value[2].split(' ');
            drawfirstcharts(value[0], dispdata, powdata, "indicator-3", "有功功率功图", "位移", "米", "有功功率", "kW");
        }
        function getsecondchartvalue(t) {
            var s = $("#Load").attr("value").split('--');
            var timedata = new Array();
            var loaddata1 = new Array();
            var loaddata2 = new Array();
            for (var i = 0; i < 6; i++) {
                timedata[i] = new Object();
                loaddata1[i] = new Object();
                loaddata2[i] = new Object();
            }
            for (var i = 0; i<6; i++)
            {
                var j = parseFloat(s.length - 2) - parseFloat(i * t);
                if (j >= 0) {
                    var x = s[j];
                    var value = x.split('_');//这样分隔之后，第一个是时间，后两个是数据
                    timedata[5 - i] = (value[0].split(' '))[0] + "\n" + (value[0].split(' '))[1];
                    loaddata1[5 - i] = value[1];
                    loaddata2[5 - i] = value[2];
                }
                else {
                    timedata[5 - i] = '0000/00/00\n00:00:00';
                    loaddata1[5 - i] = 0;
                    loaddata2[5 - i] = 0;
                }
            }
            drawsecondcharts(timedata, loaddata1, loaddata2);
        }
        //function getthirdchartvalue(t) {
        //    var s = $("#Pow").attr("value").split('--');
        //    var timedata = new Array();
        //    var powdata1 = new Array();
        //    var powdata2 = new Array();
        //    for (var i = 0; i < 6; i++) {
        //        timedata[i] = new Object();
        //        powdata1[i] = new Object();
        //        powdata2[i] = new Object();
        //    }
        //    for (var i = 0; i < 6; i++) {
        //        var j = parseFloat(s.length - 2) - parseFloat(i * t);
        //        if (j >= 0) {
        //            var x = s[j];
        //            var value = x.split('_');//这样分隔之后，第一个是时间，后两个是数据
        //            timedata[5 - i] = (value[0].split(' '))[0] + "\n" + (value[0].split(' '))[1];
        //            powdata1[5 - i] = value[1];
        //            powdata2[5 - i] = value[2];
        //        }
        //        else {
        //            timedata[5 - i] = '0000/00/00\n00:00:00';
        //            powdata1[5 - i] = 0;
        //            powdata2[5 - i] = 0;
        //        }
        //    }
        //    drawthirdcharts(timedata, powdata1, powdata2);
        //}
        //function getsixthchartvalue(t) {
        //    var s = $("#Press").attr("value").split('--');
        //    var timedata = new Array();
        //    var pressdata1 = new Array();
        //    var pressdata2 = new Array();
        //    var pressdata3 = new Array();
        //    for (var i = 0; i < 6; i++) {
        //        timedata[i] = new Object();
        //        pressdata1[i] = new Object();
        //        pressdata2[i] = new Object();
        //        pressdata3[i] = new Object();
        //    }
        //    for (var i = 0; i < 6; i++) {
        //        var j = parseFloat(s.length - 2) - parseFloat(i * t);
        //        if (j >= 0) {
        //            var x = s[j];
        //            var value = x.split('_');//这样分隔之后，第一个是时间，后两个是数据
        //            timedata[5 - i] = (value[0].split(' '))[0] + "\n" + (value[0].split(' '))[1];
        //            pressdata1[5 - i] = value[1];
        //            pressdata2[5 - i] = value[2];
        //            pressdata3[5 - i] = value[3];
        //        }
        //        else {
        //            timedata[5 - i] = '0000/00/00\n00:00:00';
        //            pressdata1[5 - i] = 0;
        //            pressdata2[5 - i] = 0;
        //            pressdata3[5 - i] = 0;
        //        }
        //    }
        //    drawsixthcharts(timedata, pressdata1, pressdata2, pressdata3);
        //}
        //function geteighthchartvalue(t) {
        //    var s = $("#PressAndTemp").attr("value").split('--');
        //    var timedata = new Array();
        //    var pressdata = new Array();
        //    var tempdata = new Array();
        //    for (var i = 0; i < 6; i++) {
        //        timedata[i] = new Object();
        //        pressdata[i] = new Object();
        //        tempdata[i] = new Object();
        //    }
        //    for (var i = 0; i < 6; i++) {
        //        var j = parseFloat(s.length - 2) - parseFloat(i * t);
        //        if (j >= 0) {
        //            var x = s[j];
        //            var value = x.split('_');//这样分隔之后，第一个是时间，后两个是数据
        //            timedata[5 - i] = (value[0].split(' '))[0] + "\n" + (value[0].split(' '))[1];
        //            pressdata[5 - i] = parseFloat(value[1]);
        //            tempdata[5 - i] = parseFloat(value[2]);
        //        }
        //        else {
        //            timedata[5 - i] = '0000/00/00\n00:00:00';
        //            pressdata[5 - i] = parseFloat(0);
        //            tempdata[5 - i] = parseFloat(0);
        //        }
        //    }
        //    draweighthcharts(timedata, pressdata, tempdata);
        //}
        function drawfirstcharts(name, dispdata, loaddata,weizhi,tablename,xtext,xlable,ytext,ylable) {
            var data = new Array();
            dispdata.pop();
            loaddata.pop();
            for (var j = 0; j < dispdata.length ; j++) {
                data.push([parseFloat(dispdata[j]) / 1000, parseFloat(loaddata[j]) / 100]);
            }
            var myChart = echarts.init(document.getElementById(weizhi));
            var option = {
                title: {
                    left: 'center',
                    text: tablename+'('+name+')',
                    textStyle: {
                        fontSize: 13
                    }
                },
                exporting: {
                    enabled: true//提供下载
                },
                tooltip: {
                    formatter: function (params) {
                        var data = params.data || [0, 0];
                        return xtext + '：' + data[0].toFixed(2) + '（' + xlable + '）, '+ytext+'：' + data[1].toFixed(2) + '（' + ylable + '）';
                    }
                },
                grid: {
                    left: '5%',
                    right: '24%',
                    bottom: '3%',
                    containLabel: true
                },
                xAxis: {
                    min: 0,
                    max: Math.floor(Math.max.apply(null, dispdata)/1000) + 1,
                    type: 'value',
                    name: xtext+'('+xlable+')',
                    axisLine: { onZero: false }
                },
                yAxis: {
                    min: Math.floor(Math.min.apply(null, loaddata)/100) - 10,
                    max: Math.floor(Math.max.apply(null, loaddata)/100) + 10,
                    type: 'value',
                    name: ytext + '(' + ylable + ')',
                    axisLine: { onZero: false }
                },
                legend: {
                    layout: 'vertical',
                    align: 'right',
                    verticalAlign: 'top',
                    x: 10,
                    y: 100,
                    borderWidth: 0
                },
                series: []
            };
            option.series = new Array();
            option.series[0] = new Object();
            option.series[0].type = 'line';
            option.series[0].animation = false;
            option.series[0].smoth = true;
            option.series[0].symbolSize = 1;
            option.series[0].data = data;
            option.series[0].showInLegend = false;
            myChart.setOption(option);
            charts.push(myChart);
        }
        function drawsecondcharts(xdata, data1, data2) {
            var myChart = echarts.init(document.getElementById("Load"));
            var option = {
                title: {
                    show:false,
                    left: 'center',
                    text: '',
                    textStyle: {
                        fontSize: 1
                    }
                },
                exporting: {
                    enabled: true//提供下载
                },
                tooltip: {
                    trigger: 'axis'
                },
                grid: {
                    left: 10,
                    bottom: 20,
                    containLabel: true
                },
                xAxis: {
                    type: 'category',
                    name: '时间',
                    axisLine: { onZero: false },
                    data: xdata,
                    axisLabel: {
                        //interval: 0,
                   }
                },
                yAxis: {
                    type: 'value',
                    name: '载荷(KN)',
                    axisLine: { onZero: false }
                },
                legend: {
                    layout: 'vertical',
                    x: 'center',
                    y: 'bottom',
                    borderWidth: 0,
                    data: ['最大载荷', '最小载荷']
                },
                series: []
            };
            option.series = new Array();
            option.series[0] = new Object();
            option.series[0].name = '最大载荷';
            option.series[0].type = 'bar';
            option.series[0].data = data1;
            option.series[1] = new Object();
            option.series[1].name = '最小载荷';
            option.series[1].type = 'bar';
            option.series[1].data = data2;
            //option.toolbox = {
            //    orient: 'horizontal',
            //    right: '3%',
            //    itemSize: 30,
            //    itemGap: 10,
            //    feature: {
            //        myTool1: {
            //            show: true,
            //            title: '6H',
            //            icon: 'image://../../Images/6h1.jpg',
            //            onclick: function () {
            //                getsecondchartvalue(1);
            //            }
            //        },
            //        myTool2: {
            //            show: true,
            //            title: '12H',
            //            icon: 'image://../../Images/12h1.jpg',
            //            onclick: function () {
            //                getsecondchartvalue(2);
            //            }
            //        },
            //        myTool3: {
            //            show: true,
            //            title: '24H',
            //            icon: 'image://../../Images/24h1.jpg',
            //            onclick: function () {
            //                getsecondchartvalue(4);
            //            }
            //        },
            //    }
            //}
            myChart.setOption(option);
            charts.push(myChart);
        }
        //function drawthirdcharts(xdata, data1, data2) {
        //    var myChart = echarts.init(document.getElementById("Pow"));
        //    var option = {
        //        title: {
        //            show: false,
        //            left: 'center',
        //            text: '功率变化图',
        //            textStyle: {
        //                fontSize: 13
        //            }
        //        },
        //        exporting: {
        //            enabled: true//提供下载
        //        },
        //        tooltip: {
        //            trigger: 'axis'
        //        },
        //        grid: {
        //            left: 10,
        //            bottom: 20,
        //            containLabel: true
        //        },
        //        xAxis: {
        //            type: 'category',
        //            name: '时间',
        //            axisLine: { onZero: false },
        //            data: xdata,
        //            axisLabel: {
        //                //interval: 0
        //            }
        //        },
        //        yAxis: {
        //            type: 'value',
        //            name: '功率(KW)',
        //            axisLine: { onZero: false }
        //        },
        //        legend: {
        //            layout: 'vertical',
        //            x: 'center',
        //            y: 'bottom',
        //            borderWidth: 0,
        //            data: ['有功功率', '无功功率']
        //        },
        //        series: []
        //    };
        //    option.series = new Array();
        //    option.series[0] = new Object();
        //    option.series[0].name = '有功功率';
        //    option.series[0].type = 'bar';
        //    option.series[0].data = data1;
        //    option.series[1] = new Object();
        //    option.series[1].name = '无功功率';
        //    option.series[1].type = 'bar';
        //    option.series[1].data = data2;
        //    //option.toolbox = {
        //    //    orient: 'horizontal',
        //    //    right: '3%',
        //    //    itemSize: 30,
        //    //    itemGap: 10,
        //    //    feature: {
        //    //        myTool1: {
        //    //            show: true,
        //    //            title: '6H',
        //    //            icon: 'image://../../Images/6h1.jpg',
        //    //            onclick: function () {
        //    //                getthirdchartvalue(1);
        //    //            }
        //    //        },
        //    //        myTool2: {
        //    //            show: true,
        //    //            title: '12H',
        //    //            icon: 'image://../../Images/12h1.jpg',
        //    //            onclick: function () {
        //    //                getthirdchartvalue(2);
        //    //            }
        //    //        },
        //    //        myTool3: {
        //    //            show: true,
        //    //            title: '24H',
        //    //            icon: 'image://../../Images/24h1.jpg',
        //    //            onclick: function () {
        //    //                getthirdchartvalue(4);
        //    //            }
        //    //        },
        //    //    }
        //    //}
        //    myChart.setOption(option);
        //    charts.push(myChart);
        //}
        function drawfourthcharts(xdata1, dataA1, dataB1, dataC1) {
            var xdata = new Array();
            var dataA = new Array();
            var dataB = new Array();
            var dataC = new Array();
            for (var i = xdata1.length - 1; i >= 0; i--)
            {
                xdata.push(xdata1[i]);
                dataA.push(dataA1[i]);
                dataB.push(dataB1[i]);
                dataC.push(dataC1[i]);
            }
            var myChart = echarts.init(document.getElementById("Volt"));
            var option = {
                title: {
                    show:false,
                    left: 'center',
                    text: 'ABC三相电压有效值',
                    textStyle: {
                        fontSize: 13
                    }
                },
                exporting: {
                    enabled: true//提供下载
                },
                grid: {
                    left: 10,
                    bottom: 20,
                    containLabel: true
                },
                xAxis: {
                    type: 'category',
                    name: '时间',
                    axisLine: { onZero: false },
                    data: xdata
                },
                yAxis: {
                    type: 'value',
                    name: '电压（V）',
                    axisLine: { onZero: false }
                },
                tooltip: {
                    trigger: 'axis'
                },
                legend: {
                    layout: 'vertical',
                    x: 'center',
                    y: 'bottom',
                    borderWidth: 0,
                    data: ['A相电压', 'B相电压', 'C相电压']
                },
                series: []
            };
            option.series = new Array();
            option.series[0] = new Object();
            option.series[0].name = 'A相电压';
            option.series[0].type = 'line';
            option.series[0].animation = false;
            option.series[0].smoth = true;
            option.series[0].symbolSize = 1;
            option.series[0].data = dataA;
            option.series[1] = new Object();
            option.series[1].name = 'B相电压';
            option.series[1].type = 'line';
            option.series[1].animation = false;
            option.series[1].smoth = true;
            option.series[1].symbolSize = 1;
            option.series[1].data = dataB;
            option.series[2] = new Object();
            option.series[2].name = 'C相电压';
            option.series[2].type = 'line';
            option.series[2].animation = false;
            option.series[2].smoth = true;
            option.series[2].symbolSize = 1;
            option.series[2].data = dataC;
            myChart.setOption(option);
            charts.push(myChart);
        }
        function drawfifthcharts(xdata1, dataA1, dataB1, dataC1) {
            var xdata = new Array();
            var dataA = new Array();
            var dataB = new Array();
            var dataC = new Array();
            for (var i = xdata1.length - 1; i >= 0; i--) {
                xdata.push(xdata1[i]);
                dataA.push(dataA1[i]);
                dataB.push(dataB1[i]);
                dataC.push(dataC1[i]);
            }
            var myChart = echarts.init(document.getElementById("Curr"));
            var option = {
                title: {
                    show: false,
                    left: 'center',
                    text: 'ABC三相电流有效值',
                    textStyle: {
                        fontSize: 13
                    }
                },
                exporting: {
                    enabled: true//提供下载
                },
                tooltip: {
                    trigger: 'axis'
                },
                grid: {
                    left: 10,
                    bottom: 20,
                    containLabel: true
                },
                xAxis: {
                    type: 'category',
                    name: '时间',
                    axisLine: { onZero: false },
                    data: xdata
                },
                yAxis: {
                    type: 'value',
                    name: '电流（A）',
                    axisLine: { onZero: false }
                },
                legend: {
                    layout: 'horizontal',
                    x: 'center',
                    y: 'bottom',
                    borderWidth: 0,
                    data: ['A相电流', 'B相电流', 'C相电流']
                },
                series: []
            };
            option.series = new Array();
            option.series[0] = new Object();
            option.series[0].name = 'A相电流';
            option.series[0].type = 'line';
            option.series[0].animation = false;
            option.series[0].smoth = true;
            option.series[0].symbolSize = 1;
            option.series[0].data = dataA;
            option.series[1] = new Object();
            option.series[1].name = 'B相电流';
            option.series[1].type = 'line';
            option.series[1].animation = false;
            option.series[1].smoth = true;
            option.series[1].symbolSize = 1;
            option.series[1].data = dataB;
            option.series[2] = new Object();
            option.series[2].name = 'C相电流';
            option.series[2].type = 'line';
            option.series[2].animation = false;
            option.series[2].smoth = true;
            option.series[2].symbolSize = 1;
            option.series[2].data = dataC;
            myChart.setOption(option);
            charts.push(myChart);
        }
        //function drawsixthcharts(xdata, data1, data2, data3) {
            
            
        //    var myChart = echarts.init(document.getElementById("Press"));
        //    var option = {
        //        title: {
        //            show:false,
        //            left: 'center',
        //            text: '压力',
        //            textStyle: {
        //                fontSize: 13
        //            }
        //        },
        //        exporting: {
        //            enabled: true//提供下载
        //        },
        //        tooltip: {
        //            trigger: 'axis'
        //        },
        //        grid: {
        //            left: 10,
        //            bottom: 20,
        //            containLabel: true
        //        },
        //        xAxis: {
        //            type: 'category',
        //            name: '时间',
        //            axisLine: { onZero: false },
        //            data: xdata,
        //            axisLabel: {
        //                //interval: 0
        //            }
        //        },
        //        yAxis: {
        //            type: 'value',
        //            name: '压力（Pa）',
        //            axisLine: { onZero: false }
        //        },
        //        legend: {
        //            layout: 'horizontal',
        //            x: 'center',
        //            y: 'bottom',
        //            borderWidth: 0,
        //            data: ['井口油压', '井口套压', '汇管压力']
        //        },
        //        series: []
        //    };
        //    option.series = new Array();
        //    option.series[0] = new Object();
        //    option.series[0].name = '井口油压';
        //    option.series[0].type = 'bar';
        //    option.series[0].data = data1;
        //    option.series[1] = new Object();
        //    option.series[1].name = '井口套压';
        //    option.series[1].type = 'bar';
        //    option.series[1].data = data2;
        //    option.series[2] = new Object();
        //    option.series[2].name = '汇管压力';
        //    option.series[2].type = 'bar';
        //    option.series[2].data = data3;
        //    //option.toolbox = {
        //    //    orient: 'horizontal',
        //    //    right: '3%',
        //    //    itemSize: 30,
        //    //    itemGap: 10,
        //    //    feature: {
        //    //        myTool1: {
        //    //            show: true,
        //    //            title: '6H',
        //    //            icon: 'image://../../Images/6h1.jpg',
        //    //            onclick: function () {
        //    //                getsixthchartvalue(1);
        //    //            }
        //    //        },
        //    //        myTool2: {
        //    //            show: true,
        //    //            title: '12H',
        //    //            icon: 'image://../../Images/12h1.jpg',
        //    //            onclick: function () {
        //    //                getsixthchartvalue(2);
        //    //            }
        //    //        },
        //    //        myTool3: {
        //    //            show: true,
        //    //            title: '24H',
        //    //            icon: 'image://../../Images/24h1.jpg',
        //    //            onclick: function () {
        //    //                getsixthchartvalue(4);
        //    //            }
        //    //        },
        //    //    }
        //    //}
        //    myChart.setOption(option);
        //    charts.push(myChart);
        //}
        //function drawseventhcharts(xdata, data1, data2) {
        //    var data = new Array();
        //    var timedata = new Array();
        //    for (var j=data1.length-1; j>=0; j--)
        //    {
        //        timedata.push(xdata[j]);
        //        data.push([data1[j],data2[j]]);
        //    }
        //    $('#Temp').highcharts({
        //        chart: {
        //            type: 'columnrange',
        //            inverted: true,
        //            backgroundColor: '#f8f8ff',
        //        },
        //        title: {
        //            text: '',
        //            style: {
        //                fontSize: '14px'
        //            }
        //        },
        //        credits: {
        //            enabled: false
        //        },
        //        exporting: {
        //            enabled: false
        //        },
        //        xAxis: {
        //            categories: timedata
        //        },
        //        yAxis: {
        //            title: {
        //                text: '温度 ( °C )'
        //            }
        //        },
        //        tooltip: {
        //            valueSuffix: '°C'
        //        },
        //        plotOptions: {
        //            columnrange: {
        //                dataLabels: {
        //                    enabled: true,
        //                    formatter: function () {
        //                        return this.y + '°C';
        //                    }
        //                }
        //            }
        //        },
        //        legend: {
        //            enabled: false
        //        },
        //        series: [{
        //            name: '温度',
        //            data: data
        //        }]
        //    });

        //    //var myChart = echarts.init(document.getElementById("Temp"));
        //    //var option = {
        //    //    title: {
        //    //        left: 'center',
        //    //        text: '温度',
        //    //        textStyle: {
        //    //            fontSize: 13
        //    //        }
        //    //    },
        //    //    exporting: {
        //    //        enabled: true//提供下载
        //    //    },
        //    //    tooltip: {
        //    //        trigger: 'axis'
        //    //    },
        //    //    grid: {
        //    //        left: 10,
        //    //        bottom: 20,
        //    //        containLabel: true
        //    //    },
        //    //    xAxis: {
        //    //        type: 'category',
        //    //        name: '时间',
        //    //        axisLine: { onZero: false },
        //    //        data: xdata,
        //    //    },
        //    //    yAxis: {
        //    //        type: 'value',
        //    //        name: '温度（℃）',
        //    //        axisLine: { onZero: false }
        //    //    },
        //    //    legend: {
        //    //        layout: 'horizontal',
        //    //        x: 'center',
        //    //        y: 'bottom',
        //    //        borderWidth: 0,
        //    //        data: ['井口温度', '汇管温度']
        //    //    },
        //    //    series: []
        //    //};
        //    //option.series = new Array();
        //    //option.series[0] = new Object();
        //    //option.series[0].name = '井口温度';
        //    //option.series[0].type = 'bar';
        //    //option.series[0].data = data1;
        //    //option.series[1] = new Object();
        //    //option.series[1].name = '汇管温度';
        //    //option.series[1].type = 'bar';
        //    //option.series[1].data = data2;
        //    //myChart.setOption(option);
        //}
        //function draweighthcharts(xdata, data1, data2) {
        //    var option = {
        //        chart: {
        //            type: 'column',
        //            backgroundColor: '#f8f8ff',
        //        },
        //        title: {
        //            text: '',
        //            margin: 0,
        //            style: {
        //                fontSize: '1px'
        //            }
        //        },
        //        credits: {
        //            enabled: false
        //        },
        //        exporting: {
        //            enabled: false
        //        },
        //        xAxis: {
        //            categories: xdata
        //        },
        //        yAxis: [{
        //            title: {
        //                text: '温度（℃）'
        //            },
        //            lineWidth:1
        //        }, {
        //            title: {
        //                text: '压力（Pa）'
        //            },
        //            lineWidth:1,
        //            opposite: true
        //        }],
        //        legend: {
        //            shadow: false
        //        },
        //        tooltip: {
        //            shared: true
        //        },
        //        plotOptions: {
        //            column: {
        //                grouping: false,
        //                shadow: false,
        //                borderWidth: 0
        //            }
        //        },
        //        series: [{
        //            name: '温度（℃）',
        //            color: 'rgba(165,170,217,1)',
        //            pointPadding: 0.3,
        //            pointPlacement: -0.2,
        //            data: data1
        //        }, {
        //            name: '压力（Pa）',
        //            color: 'rgba(126,86,134,.9)',
        //            pointPadding: 0.4,
        //            pointPlacement: -0.2,
        //            yAxis: 1,
        //            data: data2
        //        }]
        //    };
        //    $('#PressAndTemp').highcharts(option);
        //    //var myChart = echarts.init(document.getElementById("PressAndTemp"));
        //    //var option = {
        //    //    title: {
        //    //        left: 'center',
        //    //        text: '伴热温度 伴热压力',
        //    //        textStyle: {
        //    //            fontSize: 13
        //    //        }
        //    //    },
        //    //    exporting: {
        //    //        enabled: true//提供下载
        //    //    },
        //    //    tooltip: {
        //    //        trigger:'axis'
        //    //    },
        //    //    grid: {
        //    //        left: 10,
        //    //        bottom: 20,
        //    //        containLabel: true
        //    //    },
        //    //    xAxis: [
        //    //        {
        //    //            type : 'category',
        //    //            data: xdata,
        //    //            axisLabel: {
        //    //                interval: 0
        //    //            }
        //    //        },
        //    //        {
        //    //            type : 'category',
        //    //            axisLine: {show:false},
        //    //            axisTick: {show:false},
        //    //            axisLabel: {show:false},
        //    //            splitArea: {show:false},
        //    //            splitLine: {show:false},
        //    //            data: xdata
        //    //        }
        //    //    ],
        //    //    yAxis: [{
        //    //        type: 'value',
        //    //        name: '温度（℃）',
        //    //        axisLine: { onZero: false }
        //    //    },{
        //    //        type: 'value',
        //    //        name: '压力（Pa）',
        //    //        axisLine: { onZero: false },
        //    //    },],
        //    //    legend: {
        //    //        layout: 'horizontal',
        //    //        x: 'center',
        //    //        y: 'bottom',
        //    //        borderWidth: 0,
        //    //        data: ['伴热温度', '伴热压力']
        //    //    },
        //    //    series: [
        //    //       {
        //    //           name: '伴热温度',
        //    //           type: 'bar',
        //    //           barWidth:35,
        //    //           itemStyle: {
        //    //               normal:
        //    //                   {
        //    //                       color: 'rgba(181,195,52,0.5)',
        //    //                       label: {
        //    //                           show: true,
        //    //                           position: 'top',
        //    //                           textStyle: { color: '#000000' }
        //    //                       }
        //    //                   }
        //    //           },
        //    //           data: data1
        //    //       },
        //    //       {
        //    //           name: '伴热压力',
        //    //           type: 'bar',
        //    //           barWidth: 20,
        //    //           xAxisIndex: 1,
        //    //           itemStyle: {
        //    //               normal: {
        //    //                   color: 'rgba(181,195,52,1)',
        //    //                   label: {
        //    //                       show: true,
        //    //                       position: 'top',
        //    //                       textStyle: { color: '#000000' }
        //    //                   }
        //    //               }
        //    //           },
        //    //           data: data2
        //    //       }
        //    //    ]
        //    //};
        //    //option.series = new Array();
        //    //option.series[0] = new Object();
        //    //option.series[0].name = '伴热温度';
        //    //option.series[0].type = 'bar';
        //    //option.series[0].data = data1;
        //    //option.series[1] = new Object();
        //    //option.series[1].name = '伴热压力';
        //    //option.series[1].type = 'bar';
        //    //option.series[1].xAxisIndex = 1;
        //    //option.series[1].data = data2;
        //    //option.toolbox = {
        //    //    orient: 'horizontal',
        //    //    right: '3%',
        //    //    itemSize: 30,
        //    //    itemGap: 10,
        //    //    feature: {
        //    //        myTool1: {
        //    //            show: true,
        //    //            title: '6H',
        //    //            icon: 'image://../../Images/6h1.jpg',
        //    //            onclick: function () {
        //    //                geteighthchartvalue(1);
        //    //            }
        //    //        },
        //    //        myTool2: {
        //    //            show: true,
        //    //            title: '12H',
        //    //            icon: 'image://../../Images/12h1.jpg',
        //    //            onclick: function () {
        //    //                geteighthchartvalue(2);
        //    //            }
        //    //        },
        //    //        myTool3: {
        //    //            show: true,
        //    //            title: '24H',
        //    //            icon: 'image://../../Images/24h1.jpg',
        //    //            onclick: function () {
        //    //                geteighthchartvalue(4);
        //    //            }
        //    //        },
        //    //    }
        //    //}
        //    //myChart.setOption(option);
        //}
        //function drawninethcharts(data) {
        //    c3.generate({
        //        bindto: '#Pinghenglv',
        //        title: {
        //            left: 'center',
        //            text: '平衡率',
        //            textStyle: {
        //                fontSize: 13
        //            }
        //        },
        //        data: {
        //            columns: [
        //                ['平衡率', data]
        //            ],

        //            type: 'gauge'
        //        },
        //        color: {
        //            pattern: ['#1ab394', '#BABABA']

        //        }
        //    });
        //}
        //function drawtenthcharts(data) {
        //    c3.generate({
        //        bindto: '#Xitongxiaolv',
        //        title: {
        //            left: 'center',
        //            text: '系统效率',
        //            textStyle: {
        //                fontSize: 13
        //            }
        //        },
        //        data: {
        //            columns: [
        //                ['系统效率', data]
        //            ],

        //            type: 'gauge'
        //        },
        //        color: {
        //            pattern: ['#1ab394', '#BABABA']

        //        }
        //    });
        //}
        function drawbianoutcharts(xdata1, data1) {
            var xdata = new Array();
            var dataA = new Array();
            for (var i = xdata1.length - 1; i >= 0; i--) {
                xdata.push(xdata1[i]);
                dataA.push(data1[i]);
            }
            var myChart = echarts.init(document.getElementById("BianOut"));
            var option = {
                title: {
                    show: false,
                    left: 'center',
                    text: '变频器输出电流',
                    textStyle: {
                        fontSize: 13
                    }
                },
                exporting: {
                    enabled: true//提供下载
                },
                grid: {
                    left: 10,
                    bottom: 20,
                    containLabel: true
                },
                xAxis: {
                    type: 'category',
                    name: '时间',
                    axisLine: { onZero: false },
                    data: xdata
                },
                yAxis: {
                    type: 'value',
                    name: '电流（A）',
                    axisLine: { onZero: false }
                },
                tooltip: {
                    trigger: 'axis'
                },
                legend: {
                    layout: 'vertical',
                    x: 'center',
                    y: 'bottom',
                    borderWidth: 0,
                    data: ['变频器输出电流']
                },
                series: []
            };
            option.series = new Array();
            option.series[0] = new Object();
            option.series[0].name = '变频器输出电流';
            option.series[0].type = 'line';
            option.series[0].animation = false;
            option.series[0].smoth = true;
            option.series[0].symbolSize = 1;
            option.series[0].data = dataA;
            myChart.setOption(option);
            charts.push(myChart);
        }
        function start() {
            //$.ajax({
            //    url: "/Adjust/Adjust",
            //    method: 'GET',
            //    data: { data: sessionStorage.wellid + ',' + sessionStorage.username + ',CT_CTRL,M1133,0x2B7C,0$' },
            //    dataType: 'json',
            //    success: function (data) {
            //        if (data.status == -1) { alert("服务器链接超时") }
            //        else if (data.status == -2) { alert("服务器链接失败") }
            //        else if (data.status == -3) { alert("RTU网络异常") }
            //        else if (data.status == -4) { alert("一次遥调参数过多，请少于10个") }
            //        else if (data.status == -10) { alert("对不起，您没有权限遥控！") }
            //        else {
            //            alert("成功遥控");
            //            refreshdata(name);
            //        }
            //    },
            //    error: function () {
            //         swal({
            //  title: "Welcome in Alerts",
            //  text: "The connection between server and units is not very stable. For any technical assistant, please call 1-(517)-927-5910."
           //  });
            //    }
            //});
        }
        function stop() {
            //$.ajax({
            //    url: "/Adjust/Adjust",
            //    method: 'GET',
            //    data: { data: sessionStorage.wellid + ',' + sessionStorage.username + ',CT_CTRL,M1133,0x2B7C,1$' },
            //    dataType: 'json',
            //    success: function (data) {
            //        if (data.status == -1) { alert("服务器链接超时") }
            //        else if (data.status == -2) { alert("服务器链接失败") }
            //        else if (data.status == -3) { alert("RTU网络异常") }
            //        else if (data.status == -4) { alert("一次遥调参数过多，请少于10个") }
            //        else if (data.status == -10) { alert("对不起，您没有权限遥控！") }
            //        else {
            //            alert("成功遥控");
            //            refreshdata(name);
            //        }
            //    },
            //    error: function () {      
            //  swal({
            //  title: "Welcome in Alerts",
            //  text: "The connection between server and units is not very stable. For any technical assistant, please call 1-(517)-927-5910."
            // });
            //    }
            //});
        }
        function sharpstop() {
            //$.ajax({
            //    url: "/Adjust/Adjust",
            //    method: 'GET',
            //    data: { data: sessionStorage.wellid + ',' + sessionStorage.username + ',CT_CTRL,M1133,0x2B7C,1$' },
            //    dataType: 'json',
            //    success: function (data) {
            //        if (data.status == -1) { alert("服务器链接超时") }
            //        else if (data.status == -2) { alert("服务器链接失败") }
            //        else if (data.status == -3) { alert("RTU网络异常") }
            //        else if (data.status == -4) { alert("一次遥调参数过多，请少于10个") }
            //        else if (data.status == -10) { alert("对不起，您没有权限遥控！") }
            //        else {
            //            alert("成功遥控");
            //            refreshdata(name);
            //        }
            //    },
            //    error: function () {
            //        alert("网络错误！请刷新后重试。");
            //    }
            //});
        }
        function updatestroke() {
            var v = $("#slider4").attr('value').split(';');;
            var t2 =v[0];
            var t1 =v[1]-v[0];
            //alert(t1);
           // alert(t2);
            var l = $('#updatestrokebutton').ladda();
            adjustata = sessionStorage.wellid + ',' + sessionStorage.username + ',CT_ADJU,MW1589,0x0634,' + (t1 * 100) + '$' + sessionStorage.wellid + ',' + sessionStorage.username + ',CT_ADJU,MW1590,0x0635,-' + (t2 * 100) + '$';
            l.ladda('start');
            $.ajax({
                url: "/Adjust/Adjust",
                method: 'GET',
                data: { data: adjustata },
                async: true,
                dataType: 'json',
                success: function (data) {
                    l.ladda('stop');
                    if (data.status == -1) {
                        swal({
                            title: "Welcome in Alerts!",
                            text: "The server connection timed out."
                        });
                    }
                    else if (data.status == -2) {
                        swal({
                            title: "Welcome in Alerts!",
                            text: "The server connection failed."
                        });
                    }
                    else if (data.status == -3) {
                        swal({
                            title: "Welcome in Alerts!",
                            text: "RTU network exception."
                        });
                    }
                    else if (data.status == -4) {
                        swal({
                            title: "Welcome in Alerts!",
                            text: "There are too many remote control parameters, please less than 10."
                        });
                    }
                    else if (data.status == -10) {
                        swal({
                            title: "Welcome in Alerts!",
                            text: "Sorry, you do not have permission to telepresence!"
                        });
                    }
                    else if (data.status == -11) {
                        swal({
                            title: "Welcome in Alerts!",
                            text: "RTU dropped!"
                        });
                    }
                    else if (data.status == -12) {
                        swal({
                            title: "Welcome in Alerts!",
                            text: "Remote timeout!"
                        });
                    }
                    else if (data.status == -13) {
                        swal({
                            title: "Welcome in Alerts!",
                            text: "Remote control failed!"
                        });
                    }
                    else if (data.status == -14) {
                        swal({
                            title: "Welcome in Alerts!",
                            text: "Desktop program does not allow remote control, please contact the administrator!"
                        });
                    }
                    else {
                        swal({
                            title: "Welcome in Alerts!",
                            text: "Successful remote control parameter "+ data.status +", including "+ data.data
                        }); 
                    }
                },
                error: function () {
                    swal({
                        title: "Welcome in Alerts",
                        text: "The connection between server and units is not very stable. For any technical assistant, please call 1-(517)-927-5910."
                    });
                }
            });
            //alert(t1 + " " + t2);
            //l.ladda('stop');
        }
        function updatestroketimes() {
            var t1 = $("#upstroketimes").attr('value');
            var t2 = $("#downstroketimes").attr('value');
            var l = $('#updatestroketimebutton').ladda();
            l.ladda('start');
            adjustata = sessionStorage.wellid + ',' + sessionStorage.username + ',CT_ADJU,MW1591,0x0636,' + (t1 * 100) + '$' + sessionStorage.wellid + ',' + sessionStorage.username + ',CT_ADJU,MW1592,0x0637,' + (t2 * 100) + '$';
            l.ladda('start');
            $.ajax({
                url: "/Adjust/Adjust",
                method: 'GET',
                data: { data: adjustata },
                async: true,
                dataType: 'json',
                success: function (data) {
                    l.ladda('stop');
                    if (data.status == -1) {swal({
                        title: "Welcome in Alerts!",
                        text: "The server connection timed out."
                    }); }
                    else if (data.status == -2) {swal({
                        title: "Welcome in Alerts!",
                        text: "The server connection failed."
                    });}
                    else if (data.status == -3) { swal({
                        title: "Welcome in Alerts!",
                        text: "RTU network exception."
                    }); }
                    else if (data.status == -4) { swal({
                        title: "Welcome in Alerts!",
                        text: "There are too many remote control parameters, please less than 10."
                    }); }
                    else if (data.status == -10) { swal({
                        title: "Welcome in Alerts!",
                        text: "Sorry, you do not have permission to telepresence!"
                    }); }
                    else if (data.status == -11) { swal({
                        title: "Welcome in Alerts!",
                        text: "RTU dropped!"
                    }); }
                    else if (data.status == -12) { swal({
                        title: "Welcome in Alerts!",
                        text: "Remote timeout!"
                    }); }
                    else if (data.status == -13) {swal({
                        title: "Welcome in Alerts!",
                        text: "Remote control failed!"
                    });}
                    else if (data.status == -14) { swal({
                        title: "Welcome in Alerts!",
                        text: "Desktop program does not allow remote control, please contact the administrator!"
                    }); }
                    else {
                        swal({
                            title: "Welcome in Alerts!",
                            text: "Successful remote control parameter "+ data.status +", including "+ data.data
                        }); 
                    }
                },
                error: function () {
                    swal({
                        title: "Welcome in Alerts",
                        text: "The connection between server and units is not very stable. For any technical assistant, please call 1-(517)-927-5910."
                    });
                }
            });
            //alert(t1 + " " + t2);
            //l.ladda('stop');
        }
        function gotomodel() {
            $.ajax({
                url: "/Map/ColorPlanOfWell",
                method: 'GET',
                dataType: 'json',
                data: { wellid: sessionStorage.wellid },
                async: false,
                success: function (data) {
                    colorplan = data;
                }
            });
            $("#mapcontainer").empty();
            $.ajax({
                url: "/WellList/OneWellOfBlock",
                method: 'GET',
                dataType: 'json',
                data: { wellid: sessionStorage.wellid },
                async: false,
                success: function (data) {
                    if (data.status == 7) { swal({
                        title: "Welcome in Alerts!",
                        text: "Authority error."
                    }); }
                    else if (data.status == 0) {
                        $("#mapcontainer").css("background-image", "url(http://104.219.42.52:8888" + data.oneblock.MapPath + ")");
                        //$.each(data.data, function (i, item) {
                        //    $("#mapcontainer").append('<div class="mark-container popover-show" id="' + item.ID + '" data-toggle="popover" style="left:' + item.Width + ';top:' + item.Height + '"><div class="pin bg' + item.Status + '"><span class="num">' + item.ID + '</span></div><div class="pulse ' + item.Status + '"></div></div>')
                        //});
                        $("#mapcontainer").append('<div class="mark-container" id="' + data.data.ID + '" style="left:' + data.data.Width * 100 + '%;top:' + data.data.Height * 100 + '%; background-color:' + colorplan.data.WellBg + '; border:10px double ' + colorplan.data.WellBorder + '; transform:rotate(' + data.data.Angle + 'deg);"></div>')
                    }
                },
                error: function () {
                    swal({
                        title: "Welcome in Alerts",
                        text: "The connection between server and units is not very stable. For any technical assistant, please call 1-(517)-927-5910."
                    });
                }
            });
            $("#videopath").attr("src", "http://player.youku.com/embed/XMjU1MTM5Nzk4OA==");
        }
        function closevideo() {
            $("#videopath").attr("src", null);
        }
        window.onresize = function () {
            $(charts).each(function (index, chart) {
                chart.resize();
            });
        }
        function getwarn()
        {
            $.ajax({
                url: '/WarnLog/GetWellWarn',
                data: { wellid: sessionStorage.wellid },
                type: 'post',
                dataType: 'json'
            }).success(function (result) {
                if (result.status == 0) {
                    $('#newwarnlog').append('<table class="table table-striped" id="newwarnlog1"><thead><tr style = "text-align:center;">最新报警信息</tr></thead><tbody></tbody></table>')
                    littlediv = $('#newwarnlog1');
                    littlediv.append('<tr><td>报警信息</td><td>报警开始时间</td><td>报警结束时间</td><td>报警记录状态</td><td>操作</td></tr>');
                    $.each(result.data, function (i, item) {
                        if (i < 3)
                        {
                            var yorn = "未忽略报警";
                            if (item.isCheck == 2)
                            {
                                yorn = "已忽略报警";
                            }
                            littlediv.append('<tr><td>' + item.IDCode + '</td><td>' + item.ActionTime + '</td><td>' + item.ErrorEndTime + '</td><td>' + yorn + '</td><td><button type="button" onclick="inform(' + item.RecordeID + ',' + item.WELL_ID + ')" class="btn btn-xs btn-primary" data-toggle="modal" data-target="#myModal3">通知</button></td></tr>');
                        }
                        //if (s.indexOf("-" + item.RecordeID + "-") > -1) {
                        //    sessionStorage.recordId = sessionStorage.recordId + "-" + item.RecordeID + "-";
                        //}
                        //else {
                        //    showtoast(item.WELL_ID, item.IDCode, item.RecordeID);
                        //    sessionStorage.recordId = sessionStorage.recordId + "-" + item.RecordeID + "-";
                        //}
                    });
                }
                else if (result.status == 3)
                {
                    $('#newwarnlog').append('<table class="table table-striped" id="newwarnlog1"><thead><tr><th style = "text-align:center;">暂无此井的报警信息</th></tr></thead><tbody></tbody></table>')
                }
            }).error(function () {
                alert("未知错误")
            });
        }

        function inform(id, wellid) {
            GetOptions(wellid, id);
        }
        function GetOptions(wellid, id) {
            $("#Options").empty();
            $("#informinformation").empty();
            $("#workercontainer").attr("value", id);
            $("<option></option>")
            .val("0")
            .text("请选择-")
            .appendTo($("#Options"));
            $.ajax({
                url: "/WarnLog/GetOnesWorker",
                method: 'GET',
                dataType: 'json',
                data: { wellid: wellid },
                async: false,
                success: function (result) {
                    $.each(result.data, function (i, item) {
                        $("<option></option>")
                        .val(item.PhoneNumber)
                        .text(item.UserName)
                        .appendTo($("#Options"));
                    });
                    $("#Options").change(function () {
                        var id = $('#workercontainer').attr("value");
                        var name = $('#Options option:selected').text();
                        var phone = $('#Options option:selected').val();
                        var s = "将" + id + "号错误通知" + name + ",电话：" + phone;
                        $("#informinformation").empty();
                        $("<div>" + s + "</div>").appendTo($("#informinformation"));
                    });
                }
            });
        }
    </script>
}
